﻿using System.Text.RegularExpressions;

namespace Patterns.Tools.CodeGenerators.GoogleCode
{
	public static class NumberOf
	{
		private static readonly Regex _dot = new Regex(@"\.+");
		private static readonly Regex _underscore = new Regex(@"_+");

		public static int Dots(string text)
		{
			return _dot.Matches(text).Count;
		}

		public static int Underscores(string text)
		{
			return _underscore.Matches(text).Count;
		}
	}
}